/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package heartsserver;

import java.io.Serializable;

/**
 *
 * @author quangduc
 */
public class Card implements Serializable{
    private int number; //Quân bài
    private int type; //Chat
    private int player;
    private boolean isUse;
    
    public Card(int number, int type)
    {
        this.number =  number;
        this.type = type;
    }
    
    public Card(int number, int type, int player)
    {
        this.number =  number;
        this.type = type;
        this.player = player;
    }
    

    /**
     * @return the number
     */
    public int getNumber() {
        return number;
    }

    /**
     * @param number the number to set
     */
    public void setNumber(int number) {
        this.number = number;
    }

    /**
     * @return the type
     */
    public int getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(int type) {
        this.type = type;
    }

    /**
     * @return the player
     */
    public int getPlayer() {
        return player;
    }

    /**
     * @param player the player to set
     */
    public void setPlayer(int player) {
        this.player = player;
    }

    /**
     * @return the isUse
     */
    public boolean isIsUse() {
        return isUse;
    }

    /**
     * @param isUse the isUse to set
     */
    public void setIsUse(boolean isUse) {
        this.isUse = isUse;
    }
    
      public boolean isLower(Card card) {
        if (this.type < card.type) {
            return true;
        }
        if (this.type == card.type) {
            if (this.number < card.number) {
                return true;
            }
        }
        return false;
    }
}
